package Day8.ZuoYe;

import Day3.ZuoYe.Company.Staff;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

//2:输入一个文件名，输出他的文本内容
public class Zuoye2 {
    public static void main(String[] args) {
        FileReader r=null;
        try {
            r=new FileReader("D:\\java课程及作业\\wang\\4567.txt");
            char[] c = new char[1024];
            int a=0;
            while ((a=r.read(c))!=-1){
                System.out.println(new String(c,0,a));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                r.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
